<?php
/**
 *
 * @authors  Ysg (y.shi.guo@gmail.com)
 * @website  http://ysg.bonza.cn
 * @date     2017-08-10 16:26:22
 */

class MediaAdapter implements MediaPlayer
{
	private $advanceMediaPlayer=null;

    function __construct($type)
    {
    	switch ($type) {
    		case 'mp4':
		    	$this->advanceMediaPlayer = new Mp4Player();
    			break;
    		default:
				$this->advanceMediaPlayer = new VlcPlayer();
    			break;
    	}
    }
    public function play($type)
    {
    	switch ($type) {
    		case 'mp4':
		    	$this->advanceMediaPlayer->playMp4();
    			break;
    		default:
				$this->advanceMediaPlayer->playVlc();
    			break;
    	}

    }
}
